package com.zd.service.lmpl;/**
 * @Description: DriverServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-06
 * @Version:v1.0
 */

import com.zd.mapper.DriverMapper;
import com.zd.service.lnter.DriverServicelnter;
import com.zzg.entity.Driver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description: DriverServicelmpl
 * @Author:pioneer
 * @Date: 2021-07-06
 * @Version:v1.0
 */
@Service
public class DriverServicelmpl implements DriverServicelnter {
    @Autowired
    public DriverMapper driverMapper;

    /**
     * 根据id修改车辆相关信息
     *
     * @param shipping      车辆id
     * @param drivers       司机
     * @param driversphone  司机电话
     * @param vehicleremark 车辆备注
     * @return 返回数值判断是否成功
     */
    @Override
    public int updateDriverBy(String shipping, String drivers, String driversphone, String vehicleremark) {
        return driverMapper.updateDriverBy (shipping,drivers,driversphone,vehicleremark);
    }

    /**
     * 根据车辆id修改车辆相关信息
     *
     * @param driverid  车辆id
     * @param ownerName 司机姓名
     * @param phone     司机电话
     * @return 返回数值判断是否修改成功
     */
    @Override
    public int updateDriver(String driverid, String ownerName, String phone) {
        return driverMapper.updateDriver (driverid,ownerName,phone);
    }

    /**
     * 根据车辆id获得车辆信息
     *
     * @param driverid 车辆id
     * @return 车辆对象
     */
    @Override
    public Driver getDriverByid(String driverid) {
        return driverMapper.getDriverByid (driverid);
    }
}
